Skip to content

Conversation

@Ecordonnier
Copy link
Contributor

@Ecordonnier Ecordonnier commented Nov 25, 2025

  • pseudo is a tool which simulates being root by intercepting calls to e.g. geteuid and chown (by using the LD_PRELOAD mechanism). This is used e.g. by yocto to build filesystems for embedded devices without running as root on the build machine.

  • the chown call getting removed in this commit does not work when running with pseudo and using PSEUDO_IGNORE_PATHS: in this case, the call to geteuid() gets intercepted by libpseudo.so and returns 0, however the call to chown() isn't intercepted by libpseudo.so in case it is in a path from PSEUDO_IGNORE_PATHS, and will thus fail since the process is not really root

  • the call to chown() was added in install: Manages permissions when run as root #5735 with the intent of making the test install-C-root.sh pass, however it isn't required (GNU coreutils also does not call chown just because install was called as root)

Fixes #9116

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

- `pseudo` is a tool which simulates being root by intercepting calls to e.g. `geteuid` and `chown` (by using the `LD_PRELOAD` mechanism). This is used e.g. to build filesystems for embedded devices without running as root on the build machine.

- the `chown` call getting removed in this commit does not work when running with `pseudo` and using `PSEUDO_IGNORE_PATHS`: in this case, the call to `geteuid()` gets intercepted by `libpseudo.so` and returns 0, however the call to `chown()` isn't intercepted by `libpseudo.so` in case it is in a path from `PSEUDO_IGNORE_PATHS`, and will thus fail since the process is not really root

- the call to `chown()` was added in uutils#5735 with the intent of making the test `install-C-root.sh` pass, however it isn't required (GNU coreutils also does not call `chown` just because `install` was called as root)

Fixes uutils#9116

Signed-off-by: Etienne Cordonnier <[email protected]>
@Ecordonnier Ecordonnier force-pushed the eco/fix-install-as-root branch from 68ed52e to b7e037f Compare November 25, 2025 15:55
@Ecordonnier
Copy link
Contributor Author

I've not forgotten about CI, but in this particular case it's not easy to add a meaningful test. I can add a full end-to-end test using libpseudo, but it would add an extra dependency on a Ubuntu package just for the tests. I can skip the test when the dependency is not there, but it seems to me that the extra complexity is not worth it.

Also there is already a test which is calling install as root.

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@oech3
Copy link
Contributor

oech3 commented Nov 26, 2025

#9477 (comment)

#9492

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Compatibility BUG] install calls chown() if it thinks it is running as root, when GNU coreutils did not. Breaks builds.

2 participants